package com.ft.oa.enums;

/**
 * 项目阶段枚举
 * @Time 2022-1-12 10:09:03
 * @Author liyansheng
 * 项目阶段状态:0需求调研,1方案设计,2设备采购,3系统安装,4物流发货,5现场调试,6现场培训,7项目验收
 */
public enum ProjectStages {
    REQUIREMENT_INVESTIGATION(0,"需求调研"),
    PROJECT_DESIGN(1,"方案设计"),
    EQUIPMENT_PROCUREMENT(2,"设备采购"),
    SYSTEM_INSTALLATION(3,"系统安装"),
    LOGISTICS_DELIVERY(4,"物流发货"),
    FIELD_DEBUGGING(5,"现场调试"),
    ON_THE_JOB_TRAINING(6,"现场培训"),
    PROJECT_ACCEPTANCE_INSPECTION(7,"项目验收");

    //名称
    private String name;
    //编码
    private int code;
    //构造函数
    ProjectStages(int code, String name){
        this.code = code;
        this.name = name;
    }

    /**
     * 获取名称
     * @param code
     * @return
     */
    public static String getByCode(int code) {
        for (ProjectStages value : ProjectStages.values()) {
            if (value.code == code) {
                return value.name;
            }
        }
        return "";
    }
}
